home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
DFVB14.ZIP
/
PBC-SUBS.DOC
< prev
next >
Wrap
Text File
|
1992-09-25
|
37KB
|
1,107 lines
The following routines are available for your use. DoorFrame itself does not
use most of the routines so you may retain or delete them from DFRAMEX.LIB as
you see fit (the ones DoorFrame uses are noted - DON'T DELETE THEM!). The
library is modularized so if you don't CALL a routine in your code, it will
not be included in the final .EXE file. Since these routines come from the
PBClone library by Tom Hanlin, I have taken the liberty of including his
descriptions of the routines.
Name : BigPrint (Called by DoorFrame - DON'T DELETE!)
Class : Display
Level : BIOS
As the name suggests, this routine displays text in large
characters. How large? Eight times as high and as wide as
normal! Each "big character" will be composed of many
normal-sized characters. You may choose the normal character
used to create the big characters (the default is a CHR$(219)
solid block character, if you pass a null string here).
You should avoid using CHR$(128) to CHR$(255) when in either of
the CGA graphics modes, as many CGAs are unable to display
these characters when in graphics mode.
BigPrint St$, FormCh$, Row%, Column%, Attr%
St$ string to display in big characters
FormCh$ character used to compose the big characters
Row% starting row
Column% starting column
Attr% color/attribute of big characters (see CalcAttr)
NOTE: This is a local only procedure. It will NOT be sent to the
remote computer!
Name : CalcAttr (Called by DoorFrame - DON'T DELETE!)
Class : Display
Level : Any
An attribute is a combination of the foreground and background colors in a
format which is used by all types of displays when in text mode.
Foreground colors are usually specified as 0-15, with backgrounds as 0-7.
CalcAttr Foreground%, Background%, Attr%
Foreground% foreground color
Background% background color
-------
Attr% color "attribute"
Name : CalcDate (Calculate Date)
Class : Time
Level : Any
This routine calculates what the date will be a given number of
days from now, either in the past or the future. Actually, you
may use any starting date, not just the current date. An error
code is returned if the starting date or resulting date are not
valid. Dates may not preceed January 1, 1900.
CalcDate accepts the date in any standard form ("01/30/91" or
"01-30-1991", for example) and returns its results in the same
format.
CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
StartDate$ starting date
Days& number of days from the current date (0 or more)
Direction% return future result (0) or past (nonzero)
-------
NewDate$ resulting date
ErrCode% whether the dates are valid (0 yes)
Name : CDROM
Class : Disk / Equipment
Level : DOS
This routine tells you whether the Microsoft CD-ROM Extensions are installed.
If so, it tells you what the letter of the first CD-ROM logical drive is and
how many logical drives exist.
Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
This may cause unexpected results. I'm not yet sure whether DOS 5.0 is
similarly afflicted.
FirstDrive$ = "x"
CDROM FirstDrive$, Drives%
-------
FirstDrive$ letter of the first logical drive (init to at least one space!)
Drives% number of logical drives available (0 if no CD-ROM is there)
Name : CheckDate (Check Date validity)
Class : Time
Level : Any
This routine checks a date to see if it is valid.
CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
MonthNr% month number (1-12)
DayNr% day number (1-31)
YearNr% year number (1900 on; years <100 assumed 1900s)
-------
ErrCode% whether the date is valid (0 yes)
Name : CheckShare (Check for SHARE)
Class : Disk
Level : DOS
The CheckShare routine determines whether SHARE.EXE is active.
This is particularly helpful before using the BASIC OPEN
statement, which will fail if you request file sharing when
it's not available. The PBClone file routines handle such
situations automatically, so CheckShare is not needed for them.
CheckShare ShareActive%
-------
ShareActive% whether SHARE is active (0 if no)
Name : CheckShare2% (Check for SHARE)
Class : Disk
Level : DOS
The CheckShare2% function determines whether SHARE.EXE is active. This is
particularly helpful before using the BASIC OPEN statement, which will fail
if you request file sharing when it's not available. The PBClone file
routines handle such situations automatically, so CheckShare2% is not needed
for them.
ShareActive% = CheckShare2%
-------
ShareActive% whether SHARE is active (0 if no)
Name : DateA2R (Date Actual to Relative)
Class : Time
Level : Any
This routine converts an actual date to a relative date,
expressed as a number of days. This allows you to compare
dates, find out what the date will be in a given number of days
(or what it was a given number of days ago), see how many days
passed between two dates, and so forth.
I've frequently seen routines of this nature called "Julian
date" routines. I'm not sure where that nomenclature
originated, as it has nothing to do with the Julian calendar.
Most of these routines rely on approximations through floating
point math, and may or may not handle leap years and centuries
appropriately. The DateA2R routine takes no such shortcuts and
may be relied upon to return accurate results.
DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
MonthNr% month number (1-12)
DayNr% day number (1-31)
YearNr% year number (1900 on; years <100 assumed in 1900s)
-------
RelDate& relative date
Name : DateN2S (Date Numbers to String)
Class : Time
Level : Any / DOS
Many of the PBClone routines return the date as a set of
numbers. This routine provides an easy way to convert those
numbers into string form. The date format used (year length
and delimiter) will be based on the string which you pass to
the routine. For instance, "xx-xx-xxxx" will return a date
like "11-26-1990", whereas "xx.xx.xxxx" would return
"11.26.1990", and "xx/xx/xx" would return "11/26/90".
If you pass zeroes for the MonthNr%, Day%, and Year% values,
the current date will be returned in the format that you
specified.
The ProBas and PBClone versions of this routine do not work the
same way in regards to the year. ProBas assumed that any
two-digit year was in the 1900s. In contrast, PBClone assumes
that years 80-99 should be converted to 1980-1999 and that 0-79
should be converted to 2000-2079.
DateSt$ = "xx-xx-xxxx"
DateN2S MonthNr%, Day%, Year%, DateSt$
MonthNr% month
Day% day
Year% year
-------
DateSt$ date string. Init to 8 or 10 chars (see above).
Name : DateR2A (Date Relative to Actual)
Class : Time
Level : Any
This is the opposite of the DateA2R routine-- it takes a
"relative" date and converts it back to the usual form.
DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
RelDate& relative date
-------
MonthNr% month number (1-12)
DayNr% day number (1-31)
YearNr% year number (1900 on)
Name : DateS2N (Date String to Numbers)
Class : Time
Level : Any
Many of the PBClone routines need to be passed the date as a
set of numbers. This routine provides an easy way to convert a
date from string form into numbers. You may use either
"xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
length is important, but the delimiter and contents of the
string are ignored).
The ProBas and PBClone versions of this routine do not work the
same way in regards to the year. ProBas assumed that any
two-digit year was in the 1900s. In contrast, PBClone assumes
that years 80-99 should be converted to 1980-1999 and that 0-79
should be converted to 2000-2079.
DateS2N MonthNr%, Day%, Year%, DateSt$
DateSt$ date string. Init to 8